require('module-alias/register')

const app = require('./app')
const config = require('./app/config')
const https = require('https')
const fs = require('fs')
const path = require('path')
require('./app/database')

const httpsOptions = {
  key: fs.readFileSync(path.resolve(__dirname, './app/ssl/9214951_coderwyf.com.key')),
  cert: fs.readFileSync(path.resolve(__dirname, './app/ssl/9214951_coderwyf.com.pem')),
}

https.createServer(httpsOptions, app.callback()).listen(config.APP_PORT, () => {
  console.log(`服务器在${config.APP_PORT}端口启动成功~`)
})
